package com.iotechn.unimall.admin.api.store;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.StoreDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-03-22 18:22:29
 */
@HttpOpenApi(group = "admin.store", description = "门店管理")
public interface AdminStoreService {

    @HttpMethod(description = "列表", permission = "store:store:list", permissionParentName = "门店管理", permissionName = "门店列表")
    public Page<StoreDO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
           @HttpParam(name="storeName",description = "门店名称")String storeName,
            @HttpParam(name="gmtStartCreate",description = "创建开始时间")String gmtStartCreate,
            @HttpParam(name="gmtEndCreate",description = "创建结束时间")String gmtEndCreate,
            @HttpParam(name ="status",description = "状态")String status
            ) throws ServiceException;

    @HttpMethod(description = "创建", permission = "store:store:create", permissionParentName = "门店管理", permissionName = "门店列表")
    public StoreDO create(
            @NotNull @HttpParam(name = "storeDO", type = HttpParamType.COMMON, description = "") StoreDO storeDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "store:store:update", permissionParentName = "门店管理", permissionName = "门店列表")
    public String update(
            @NotNull @HttpParam(name = "storeDO", type = HttpParamType.COMMON, description = "") StoreDO storeDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "store:store:delete", permissionParentName = "门店管理", permissionName = "门店列表")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情", permission = "store:store:detail", permissionParentName = "门店管理", permissionName = "门店列表")
    public StoreDO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
    @HttpMethod(description = "更改状态", permission = "store:store:active", permissionParentName = "门店管理", permissionName = "门店列表")
    public String updateStatus(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "") Integer status,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "获取所有门店")
    public List<StoreDO> listStoresByPara(
            @HttpParam(name = "status")String status,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId)throws ServiceException;
    @HttpMethod(description = "获取所有门店")
    public List<StoreDO> listStore(@HttpParam(name = "status")String status,
                                   @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}

